[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
RIGHT() Returns runtime error if embedded in a macro.
Clipper Version 1.03 dtd 09/15/90.
Problem Statement
When RIGHT(cVar) is included in a macro statement, a runtime
error occurs when the macro is expanded.
Cause
RIGHT(cVar) is a psuedo-function, created by directive in STD.CH; i.e.,
#translate Right(<c>, <n>) => Substr( <c>, -(<n>), <n>)
Work Around(s)
1) Create a real function, RIGHT(cVar), in your .PRG; e.g.,
FUNCTION ALLTRIM
PARAMETERS cVar, nVar
RETURN SUBSTR(cVar, -nVar, nVar)
2) Create the above function and compile using the /N option.
Include the resultant .OBJ file when linking.
Note: You may delete the #translate line from MYNAME.CH.
3) Create the above function and compile using the /N option.
Add the resultant .OBJ file to a .LIB file; e.g., EXTEND.LIB.
Note: You may delete the #translate line from MYNAME.CH.
4) Replace all RIGHT(cVar) references in your .PRG with
SUBSTR(cVar, -nVar, nVar).
Note
See Support Bulletin 4 in the NANFORUM Library.
See Also:
ALLTRIM()
STD.CH
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson